<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
                <html lang="zh-CN">
                <head>
                    <meta charset="utf-8">
                    <meta http-equiv="X-UA-Compatible" content="IE=edge">
                    <meta name="viewport" content="width=device-width, initial-scale=1">
                    <title>CMS管理系统</title>

                    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                    <link rel="stylesheet" href="/Public/css/common.css">
                    
    <style>
        #page1{

        }
        #page2 {
            display: none;
        }
    </style>

                </head>
                <body>

                <nav class="navbar navbar-default navbar-fixed-top col-md-10">
                    <div class="container-fluid nav_bg">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="<?php echo U('Index/index');?>">首页</a>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <ul class="nav navbar-nav">
                                <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
                                <li><a href="<?php echo U('Link/index');?>">友情链接管理</a></li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false">前端文件管理 <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('File/index');?>">文件管理</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('Article/show');?>">Finder</a></li>
                                    </ul>
                                </li>

                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false">内容管理 <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('Article/index');?>">文章列表</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('Category/index');?>">栏目管理</a></li>
                                    </ul>
                                </li>

                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> 系统设置 <span
                                            class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('System/config');?>">站点信息</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('User/password_edit');?>">密码修改</a></li>
                                    </ul>
                                </li>

                            </ul>


                            <ul class="nav navbar-nav navbar-right">
                                <li><a href="<?php echo U('File/destroy_cache');?>">清除缓存</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">尊敬的<?php echo ($user["username"]); ?> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="<?php echo U('User/logout');?>">安全退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid">
    
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">
                            <ul id="myTabs" class="nav nav-tabs" role="tablist">
                                <li role="presentation" class="active">
                                    <a href="#home" id="category_tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">添加栏目</a>
                                </li>
                                <li role="presentation">
                                    <a href="#profile" role="content" id="content" data-toggle="tab" aria-controls="profile">栏目内容</a>
                                </li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <div class="panel-body">
                                <form class="form-horizontal col-sm-12" method="post" action="<?php echo U('store');?>">
                                    <div id="page1">

                                        <input type="hidden" name="id" value="<?php echo ($c["id"]); ?>">
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">父栏目</label>
                                            <div class="col-sm-6">

                                                <select class="form-control" name="parent_id">
                                                    <?php if(is_array($categories)): $i = 0; $__LIST__ = $categories;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$category): $mod = ($i % 2 );++$i;?><option value="<?php echo ($category["id"]); ?>" ><?php echo ($category["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                </select>

                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">名称</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="name" id="name" placeholder="" value="">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">拼音</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="pingyin" id="pingyin" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">类型</label>
                                            <div class="col-sm-6">
                                                <div class="radio">
                                                    <label>
                                                        <input type="radio" name="type" id="optionsRadios1" value="1" checked>
                                                        封面
                                                    </label>
                                                    <div class="radio">
                                                        <label>
                                                            <input type="radio" name="type" id="optionsRadios1" value="2" >
                                                            列表
                                                        </label>
                                                    </div>
                                                    <div class="radio">
                                                        <label>
                                                            <input type="radio" name="type" id="optionsRadios1" value="3" >
                                                            url
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">URL跳转地址</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="url" id="url" placeholder="">
                                            </div>
                                        </div>
                                    </div>
                                    <div id="page2">

                                        <textarea name="category_content" class="content" id="textarea"></textarea>
                                        <script src="/Public/ckeditor/ckeditor.js"></script>
                                        <script type="text/javascript" src="/Public/ckfinder/ckfinder.js"></script>
                                    </div>

                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label">是否显示</label>
                                    <div class="col-sm-6">
                                        <div class="radio" >
                                            <label>
                                                <input type="radio" name="show" id="optionsRadios1" value="1" checked>
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="show" id="optionsRadios1" value="2" >
                                                否
                                            </label>

                                        </div>
                                    </div>
                                </div>


                                <div class="form-group" >
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-default" >添加</button>
                                        <button type="button" class="btn btn-default btn-primary" disabled id="prev">返回</button>
                                    </div>
                                </div>
                             </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

</div>
<script src="/Public/js/jquery.min.js"></script>

<script src="/Public/bootstrap/js/bootstrap.min.js"></script>


    <script>
        $(function () {
            var $content = $("#content");
            var $category_tab = $("#category_tab");
            var $page1 = $("#page1");
            var $page2 = $("#page2");

            $category_tab.click(function () {
                $page2.hide();
                $page1.fadeIn(300);

            })

            $content.click(function () {
                $page1.hide();
                $page2.fadeIn(300);

            })
        })

    </script>
    <script>
        CKEDITOR.replace('category_content',
                {
                    filebrowserBrowseUrl: '/Public/ckfinder/ckfinder.html',
                    filebrowserImageBrowseUrl: '/Public/ckfinder/ckfinder.html?type=Images',
                    filebrowserFlashBrowseUrl: '/Public/ckfinder/ckfinder.html?type=Flash',
                    filebrowserUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                    filebrowserImageUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                    filebrowserFlashUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
                });
    </script>

</body>
</html>